900
|
How can I prevent a link to end to a specified bar
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Tasks")
oChart := oG2antt:Chart()
oChart:AllowLinkBars := .T.
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,160)
oChart:FirstVisibleDate := "06/20/2005"
oItems := oG2antt:Items()
h := oItems:AddItem("Not-End-Linkable")
oItems:AddBar(h,"Unknown","06/21/2005","06/28/2005")
oItems:SetProperty("ItemBar",h,"",31/*exBarCanEndLink*/,.F.)
oItems:AddBar(oItems:AddItem("Task 1"),"Task","06/23/2005","06/27/2005","")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","06/23/2005","06/27/2005","")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
899
|
How can I prevent a link to start from a specified bar
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Tasks")
oChart := oG2antt:Chart()
oChart:AllowLinkBars := .T.
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,160)
oChart:FirstVisibleDate := "06/20/2005"
oItems := oG2antt:Items()
h := oItems:AddItem("Not-Start-Linkable")
oItems:AddBar(h,"Unknown","06/21/2005","06/28/2005")
oItems:SetProperty("ItemBar",h,"",30/*exBarCanStartLink*/,.F.)
oItems:AddBar(oItems:AddItem("Task 1"),"Task","06/23/2005","06/27/2005","")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","06/23/2005","06/27/2005","")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
898
|
How can I prevent a specified bar to be linked
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Tasks")
oChart := oG2antt:Chart()
oChart:AllowLinkBars := .T.
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,160)
oChart:FirstVisibleDate := "06/20/2005"
oItems := oG2antt:Items()
h := oItems:AddItem("Not-Linkable")
oItems:AddBar(h,"Unknown","06/21/2005","06/28/2005")
oItems:SetProperty("ItemBar",h,"",32/*exBarCanBeLinked*/,.F.)
oItems:AddBar(oItems:AddItem("Task 1"),"Task","06/23/2005","06/27/2005","")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","06/23/2005","06/27/2005","")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
897
|
How can I display in the chart's header only days where the week starts

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oLevel,oLevel1
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:FirstVisibleDate := "01/31/2009"
oChart:LevelCount := 2
oChart:FirstWeekDay := 1/*exMonday*/
oLevel := oChart:Level(0)
oLevel:Label := "<%mmmm%> <%yyyy%>"
oLevel:Alignment := 1/*CenterAlignment*/
oLevel:Unit := 16/*exMonth*/
oLevel1 := oChart:Level(1)
oLevel1:Unit := 4096/*exDay*/
oLevel1:FormatLabel := " (0:=weekday(dvalue)) = 1 ? '<b>' +value : '' "
oChart:UnitWidth := 23
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
896
|
Is there any automatically way to display and change the bar's duration in the columns section

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Tasks")
oColumn := oColumns:Add("Duration")
oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,513)
oColumn:Editor():EditType := 4/*SpinType*/
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2009"
oItems := oG2antt:Items()
oItems:AllowCellValueToItemBar := .T.
oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2009","01/07/2009")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/04/2009","01/09/2009")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
895
|
How can I programatically move or resize a bar using spin or slider controls in the columns

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oColumns := oG2antt:Columns()
oColumns:Add("Tasks")
oColumn := oColumns:Add("Start")
oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
oColumn:Editor():EditType := 4/*SpinType*/
oColumn1 := oColumns:Add("End")
oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
oColumn1:Editor():EditType := 4/*SpinType*/
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:ShowEmptyBars := 1
oChart:FirstVisibleDate := "01/01/2009"
oItems := oG2antt:Items()
oItems:AllowCellValueToItemBar := .T.
oItems:AddBar(oItems:AddItem("Task 1"),"Task","01/02/2009","01/07/2009")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","01/04/2009","01/09/2009")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
894
|
I am trying to call the ItemBar(exBarStart) after curent ending point, and the bar is not updated. What I am doing wrong
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Tasks")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,64)
oChart:FirstVisibleDate := "06/21/2005"
oChart:ShowEmptyBars := 1
oItems := oG2antt:Items()
h := oItems:AddItem("Test")
oItems:AddBar(h,"Task","06/22/2005","06/26/2005","")
oItems:AddBar(h,"Task","06/27/2005",oItems:ItemBar(h,"",2/*exBarEnd*/))
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
893
|
How can change in the same time the starting and ending points of the bar
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems,oItems1
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Tasks")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,64)
oChart:FirstVisibleDate := "06/21/2005"
oChart:ShowEmptyBars := 1
oItems := oG2antt:Items()
h := oItems:AddItem("Test")
oItems:AddBar(h,"Task","06/22/2005","06/26/2005")
oItems1 := oG2antt:Items()
h := oItems1:FirstVisibleItem()
oItems1:AddBar(h,"Task","06/27/2005","06/29/2005")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
892
|
How can I control the exBarEffort property of the bar using slider controls

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBar
LOCAL oChart
LOCAL oColumn,oColumn1
LOCAL oEditor
LOCAL oItems
LOCAL h,h1
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:ShowFocusRect := .F.
oG2antt:OnResizeControl := 1/*exResizeChart*/
oG2antt:Columns():Add("Tasks"):AllowDragging := .F.
oColumn := oG2antt:Columns():Add("Histogram")
oColumn:AllowDragging := .F.
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn:AllowSizing := .F.
oColumn:Width := 18
oColumn:LevelKey := 1
oG2antt:Items():AllowCellValueToItemBar := .T.
oColumn1 := oG2antt:Columns():Add("Effort")
oColumn1:LevelKey := 1
oColumn1:AllowDragging := .F.
oColumn1:AllowSizing := .F.
oColumn1:Width := 64
oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,21)
oEditor := oColumn1:Editor()
oEditor:EditType := 20/*SliderType*/
oEditor:SetProperty("Option",41/*exSliderWidth*/,-100)
oEditor:SetProperty("Option",44/*exSliderMax*/,9)
oEditor:SetProperty("Option",43/*exSliderMin*/,1)
oChart := oG2antt:Chart()
oChart:LevelCount := 3
oChart:NonworkingDays := 0
oChart:SetProperty("PaneWidth",.F.,160)
oChart:FirstVisibleDate := "06/20/2005"
oChart:HistogramVisible := .T.
oChart:HistogramView := 67348/*0x10000+exHistogramNoGrouping+exHistogramRecLeafItems+exHistogramLeafItems+exHistogramUnlockedItems+exHistogramCheckedItems*/
oChart:HistogramHeight := 64
oBar := oChart:Bars:Item("Task")
oBar:SetProperty("HistogramCriticalColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oBar:HistogramPattern := 512/*exBezierCurve*/
oBar:HistogramType := 1/*exHistOverAllocation*/
oItems := oG2antt:Items()
h := oItems:AddItem("Project 1")
oItems:AddBar(h,"Summary","06/21/2005","07/01/2005")
oItems:SetProperty("CellEditorVisible",h,2,0/*exEditorHidden*/)
oItems:SetProperty("CellValue",h,2,"")
h1 := oItems:InsertItem(h,,"Task 1")
oItems:AddBar(h1,"Task","06/21/2005","06/28/2005")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
h1 := oItems:InsertItem(h,,"Task 2")
oItems:AddBar(h1,"Task","06/23/2005","07/01/2005","")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
oItems:SetProperty("ItemBar",h1,"",21/*exBarEffort*/,5)
h1 := oItems:InsertItem(h,,"Task 3")
oItems:AddBar(h1,"Task","06/25/2005","06/27/2005","")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("CellState",h,1,1)
h := oItems:AddItem("Project 2")
oItems:AddBar(h,"Summary","03/07/2005","07/12/2005")
oItems:SetProperty("CellEditorVisible",h,2,0/*exEditorHidden*/)
oItems:SetProperty("CellValue",h,2,"")
h1 := oItems:InsertItem(h,,"Task 1")
oItems:AddBar(h1,"Task","07/03/2005","07/08/2005")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
h1 := oItems:InsertItem(h,,"Task 2")
oItems:AddBar(h1,"Task","07/05/2005","07/12/2005","")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
oItems:SetProperty("ItemBar",h1,"",21/*exBarEffort*/,5)
h1 := oItems:InsertItem(h,,"Task 3")
oItems:AddBar(h1,"Task","07/07/2005","07/08/2005","")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("CellState",h,1,1)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
891
|
How can I determine if there is any Redo operation
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL var_CanRedo
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:AllowUndoRedo := .T.
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2001"
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
var_CanRedo := oG2antt:Chart:CanRedo()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
890
|
How can I determine if there is any Undo operation
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL var_CanUndo
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:AllowUndoRedo := .T.
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2001"
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
var_CanUndo := oG2antt:Chart:CanUndo()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
889
|
How can I turn on the Undo/Redo feature
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:AllowUndoRedo := .T.
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2001"
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
888
|
How can I disable resizing the histogram at runtime
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:OnResizeControl := 256/*exDisableHistogram*/
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2001"
oChart:HistogramVisible := .T.
oChart:HistogramHeight := 32
oChart:Bars:Item("Task"):HistogramPattern := 6/*exPatternBDiagonal*/
oG2antt:Columns():Add("Column")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2001","01/04/2001")
oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2001","01/07/2001")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
887
|
How can I display automatically the start and end dates of the bars in the columns section

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oColumns := oG2antt:Columns()
oColumns:Add("Tasks")
oColumn := oColumns:Add("Start")
oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
oColumn:Editor():EditType := 7/*DateType*/
oColumn1 := oColumns:Add("End")
oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
oColumn1:Editor():EditType := 7/*DateType*/
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "09/20/2006"
oChart:AllowLinkBars := .T.
oChart:AllowCreateBar := 0/*exNoCreateBar*/
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,196)
oItems := oG2antt:Items()
oItems:AllowCellValueToItemBar := .T.
oItems:AddBar(oItems:AddItem("Task 1"),"Task","09/21/2006","09/24/2006")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","09/22/2006","09/25/2006")
oItems:AddBar(oItems:AddItem("Task 3"),"Task","09/23/2006","09/26/2006")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
886
|
How can I enable Undo/Redo support
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn,oColumn1
LOCAL oColumns
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:DrawGridLines := 1/*exHLines*/
oColumns := oG2antt:Columns()
oColumns:Add("Tasks")
oColumn := oColumns:Add("Start")
oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
oColumn:Editor():EditType := 7/*DateType*/
oColumn:LevelKey := 1
oColumn1 := oColumns:Add("End")
oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
oColumn1:Editor():EditType := 7/*DateType*/
oColumn1:LevelKey := 1
oChart := oG2antt:Chart()
oChart:DrawGridLines := 1/*exHLines*/
oChart:FirstVisibleDate := "09/20/2006"
oChart:AllowLinkBars := .T.
oChart:AllowCreateBar := 0/*exNoCreateBar*/
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,196)
oChart:AllowUndoRedo := .T.
oItems := oG2antt:Items()
oItems:AllowCellValueToItemBar := .T.
oItems:AddBar(oItems:AddItem("Task 1"),"Task","09/21/2006","09/24/2006")
oItems:AddBar(oItems:AddItem("Task 2"),"Task","09/22/2006","09/25/2006")
oItems:AddBar(oItems:AddItem("Task 3"),"Task","09/23/2006","09/26/2006")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
885
|
Is there any option to update the bar's properties once the cell's value is changed ( associate the cell with bar )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumns
LOCAL oEditor,oEditor1
LOCAL oItems
LOCAL h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Debug := .T.
oG2antt:MarkSearchColumn := .F.
oG2antt:Items():AllowCellValueToItemBar := .T.
oColumns := oG2antt:Columns()
oColumns:Add("Tasks")
oColumns:Add("Start"):Editor():EditType := 7/*DateType*/
oColumns:Add("End"):Editor():EditType := 7/*DateType*/
oColumns:Add("Info")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "09/20/2006"
oChart:AllowLinkBars := .F.
oChart:AllowCreateBar := 0/*exNoCreateBar*/
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,224)
oItems := oG2antt:Items()
h1 := oItems:InsertItem(,,"Task 1")
oItems:AddBar(h1,"Task","09/21/2006","09/23/2006","A","Caption")
oItems:SetProperty("ItemBar",h1,"A",4/*exBarHAlignCaption*/,18)
oItems:CellEditor(h1,3):EditType := 1/*EditType*/
oItems:CellValueToItemBar(h1,1,1/*exBarStart*/,"A")
oItems:CellValueToItemBar(h1,2,2/*exBarEnd*/,"A")
oItems:CellValueToItemBar(h1,3,3/*exBarCaption*/,"A")
h2 := oItems:InsertItem(,,"Task 2")
oItems:AddBar(h2,"Task","09/22/2006","09/24/2006","B")
oEditor := oItems:CellEditor(h2,3)
oEditor:EditType := 20/*SliderType*/
oEditor:SetProperty("Option",41/*exSliderWidth*/,-100)
oItems:CellValueToItemBar(h2,1,1/*exBarStart*/,"B")
oItems:CellValueToItemBar(h2,2,2/*exBarEnd*/,"B")
oItems:CellValueToItemBar(h2,3,19/*exBarTransparent*/,"B")
h3 := oItems:InsertItem(,,"Task 3")
oItems:AddBar(h3,"Task","09/23/2006","09/25/2006","C")
oEditor1 := oItems:CellEditor(h3,3)
oEditor1:EditType := 2/*DropDownType*/
oEditor1:AddItem(0,"Task")
oEditor1:AddItem(1,"Progress")
oEditor1:AddItem(2,"Project Summary")
oEditor1:AddItem(2,"Summary")
oItems:CellValueToItemBar(h3,1,1/*exBarStart*/,"C")
oItems:CellValueToItemBar(h3,2,2/*exBarEnd*/,"C")
oItems:CellValueToItemBar(h3,3,0/*exBarName*/,"C")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
884
|
Is there any option to update the bar's properties once the cell's value is changed ( associate the column/cell with bars )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn,oColumn1,oColumn2
LOCAL oColumns
LOCAL oEditor
LOCAL oItems
LOCAL h,h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:Indent := 11
oG2antt:HasLines := 1/*exSolidLine*/
oG2antt:Items():AllowCellValueToItemBar := .T.
oColumns := oG2antt:Columns()
oColumns:Add("Tasks")
oColumn := oColumns:Add("Start")
oColumn:SetProperty("Def",18/*exCellValueToItemBarProperty*/,1)
oColumn:Editor():EditType := 7/*DateType*/
oColumn:LevelKey := 1
oColumn1 := oColumns:Add("End")
oColumn1:SetProperty("Def",18/*exCellValueToItemBarProperty*/,2)
oColumn1:Editor():EditType := 7/*DateType*/
oColumn1:LevelKey := 1
oColumn2 := oColumns:Add("Transparency")
oColumn2:SetProperty("Def",18/*exCellValueToItemBarProperty*/,19)
oEditor := oColumn2:Editor()
oEditor:EditType := 20/*SliderType*/
oEditor:SetProperty("Option",41/*exSliderWidth*/,-100)
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "09/20/2006"
oChart:AllowLinkBars := .F.
oChart:AllowCreateBar := 0/*exNoCreateBar*/
oChart:LevelCount := 2
oChart:SetProperty("PaneWidth",.F.,224)
oItems := oG2antt:Items()
h := oItems:AddItem("Project")
oItems:AddBar(h,"Summary","09/21/2006","10/03/2006")
oItems:SetProperty("CellEditorVisible",h,1,0/*exEditorHidden*/)
oItems:SetProperty("CellEditorVisible",h,2,0/*exEditorHidden*/)
h1 := oItems:InsertItem(h,,"Task 1")
oItems:AddBar(h1,"Task","09/21/2006","09/24/2006")
h2 := oItems:InsertItem(h,,"Task 2")
oItems:AddBar(h2,"Task","09/24/2006","09/28/2006")
h3 := oItems:InsertItem(h,,"Task 3")
oItems:AddBar(h3,"Task","09/28/2006","10/03/2006")
oItems:DefineSummaryBars(h,"",h1,"")
oItems:DefineSummaryBars(h,"",h2,"")
oItems:DefineSummaryBars(h,"",h3,"")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("ItemBold",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
883
|
How can I group two bars so I can specify the range or the limit of the interval between them

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h,h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:OnResizeControl := 1/*exResizeChart*/
oG2antt:Columns():Add("Tasks")
oG2antt:Columns():Add("Start"):Visible := .F.
oG2antt:Columns():Add("End"):Visible := .F.
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "09/20/2006"
oChart:SetProperty("PaneWidth",.F.,64)
oItems := oG2antt:Items()
h := oItems:AddItem("Project")
oItems:SetProperty("CellValue",h,1,"09/21/2006")
oItems:SetProperty("CellValue",h,2,"10/03/2006")
oItems:AddBar(h,"Summary",oItems:CellValue(h,1),oItems:CellValue(h,2),"sum")
h1 := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("CellValue",h1,1,oItems:CellValue(h,1))
oItems:SetProperty("CellValue",h1,2,"09/24/2006")
oItems:AddBar(h1,"Task",oItems:CellValue(h1,1),oItems:CellValue(h1,2),"K1")
h2 := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellValue",h2,1,oItems:CellValue(h1,2))
oItems:SetProperty("CellValue",h2,2,"09/28/2006")
oItems:AddBar(h2,"Unknown",oItems:CellValue(h2,1),oItems:CellValue(h2,2),"K2")
oItems:AddLink("L1",h1,"K1",h2,"K2")
h3 := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellValue",h3,1,oItems:CellValue(h2,2))
oItems:SetProperty("CellValue",h3,2,oItems:CellValue(h,2))
oItems:AddBar(h3,"Task",oItems:CellValue(h3,1),oItems:CellValue(h3,2),"K3")
oItems:AddLink("L2",h2,"K2",h3,"K3")
oItems:GroupBars(h1,"K1",.F.,h2,"K2",.T.,31,"0;4")
oItems:GroupBars(h2,"K2",.F.,h3,"K3",.T.,31,"0;2")
oItems:DefineSummaryBars(h,"sum",h1,"K1")
oItems:DefineSummaryBars(h,"sum",h2,"K2")
oItems:DefineSummaryBars(h,"sum",h3,"K3")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("ItemBold",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
882
|
How can I group my bars so I can resize the interval between them but still keep the lengths of them

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h,h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:OnResizeControl := 1/*exResizeChart*/
oG2antt:Columns():Add("Tasks")
oG2antt:Columns():Add("Start"):Visible := .F.
oG2antt:Columns():Add("End"):Visible := .F.
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "09/20/2006"
oChart:SetProperty("PaneWidth",.F.,64)
oItems := oG2antt:Items()
h := oItems:AddItem("Project")
oItems:SetProperty("CellValue",h,1,"09/21/2006")
oItems:SetProperty("CellValue",h,2,"10/03/2006")
oItems:AddBar(h,"Summary",oItems:CellValue(h,1),oItems:CellValue(h,2))
h1 := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("CellValue",h1,1,oItems:CellValue(h,1))
oItems:SetProperty("CellValue",h1,2,"09/24/2006")
oItems:AddBar(h1,"Task",oItems:CellValue(h1,1),oItems:CellValue(h1,2))
h2 := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellValue",h2,1,oItems:CellValue(h1,2))
oItems:SetProperty("CellValue",h2,2,"09/28/2006")
oItems:AddBar(h2,"Unknown",oItems:CellValue(h2,1),oItems:CellValue(h2,2))
oItems:AddLink("L1",h1,"",h2,"")
h3 := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellValue",h3,1,oItems:CellValue(h2,2))
oItems:SetProperty("CellValue",h3,2,oItems:CellValue(h,2))
oItems:AddBar(h3,"Task",oItems:CellValue(h3,1),oItems:CellValue(h3,2))
oItems:AddLink("L2",h2,"",h3,"")
oItems:GroupBars(h1,"",.F.,h2,"",.T.,35)
oItems:GroupBars(h2,"",.F.,h3,"",.T.,35)
oItems:DefineSummaryBars(h,"",h1,"")
oItems:DefineSummaryBars(h,"",h2,"")
oItems:DefineSummaryBars(h,"",h3,"")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("ItemBold",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
881
|
Can I group my bars so they move together when a bar inside changes, but still preserving the length of the bars

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h,h1,h2,h3
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:OnResizeControl := 1/*exResizeChart*/
oG2antt:Columns():Add("Tasks")
oG2antt:Columns():Add("Start"):Visible := .F.
oG2antt:Columns():Add("End"):Visible := .F.
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "09/20/2006"
oChart:SetProperty("PaneWidth",.F.,64)
oItems := oG2antt:Items()
h := oItems:AddItem("Project")
oItems:SetProperty("CellValue",h,1,"09/21/2006")
oItems:SetProperty("CellValue",h,2,"10/03/2006")
oItems:AddBar(h,"Summary",oItems:CellValue(h,1),oItems:CellValue(h,2))
h1 := oItems:InsertItem(h,,"Task 1")
oItems:SetProperty("CellValue",h1,1,oItems:CellValue(h,1))
oItems:SetProperty("CellValue",h1,2,"09/24/2006")
oItems:AddBar(h1,"Task",oItems:CellValue(h1,1),oItems:CellValue(h1,2))
h2 := oItems:InsertItem(h,,"Task 2")
oItems:SetProperty("CellValue",h2,1,oItems:CellValue(h1,2))
oItems:SetProperty("CellValue",h2,2,"09/28/2006")
oItems:AddBar(h2,"Unknown",oItems:CellValue(h2,1),oItems:CellValue(h2,2))
oItems:AddLink("L1",h1,"",h2,"")
h3 := oItems:InsertItem(h,,"Task 3")
oItems:SetProperty("CellValue",h3,1,oItems:CellValue(h2,2))
oItems:SetProperty("CellValue",h3,2,oItems:CellValue(h,2))
oItems:AddBar(h3,"Task",oItems:CellValue(h3,1),oItems:CellValue(h3,2))
oItems:AddLink("L2",h2,"",h3,"")
oItems:GroupBars(h1,"",.F.,h2,"",.T.,3)
oItems:GroupBars(h2,"",.F.,h3,"",.T.,3)
oItems:DefineSummaryBars(h,"",h1,"")
oItems:DefineSummaryBars(h,"",h2,"")
oItems:DefineSummaryBars(h,"",h3,"")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("ItemBold",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
880
|
How can I split the time scale, so a section displays days, while other displays weeks, and the other months

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZoom,oInsideZoom1
LOCAL oInsideZoomFormat,oInsideZoomFormat1,oInsideZoomFormat2
LOCAL oInsideZooms
LOCAL oItems
LOCAL oLevel,oLevel1,oLevel2
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:HeaderHeight := 24
oG2antt:Columns():Add("Default")
oChart := oG2antt:Chart()
oChart:DrawDateTicker := .T.
oChart:DrawGridLines := 2/*exVLines*/
oChart:NonworkingDays := 0
oChart:SetProperty("PaneWidth",.F.,0)
oChart:FirstVisibleDate := "01/01/2007"
oChart:LevelCount := 3
oLevel := oChart:Level(0)
oLevel:Label := "<%yyyy%>"
oLevel:Unit := 0/*exYear*/
oLevel1 := oChart:Level(1)
oLevel1:Alignment := 1/*CenterAlignment*/
oLevel1:Label := "<%hy%>"
oLevel1:Unit := 1/*exHalfYear*/
oLevel1:SetProperty("ReplaceLabel","1","<b>1/2</b>")
oLevel1:SetProperty("ReplaceLabel","2","<b>2/2</b>")
oLevel2 := oChart:Level(2)
oLevel2:Label := "<%mmm%>"
oLevel2:Unit := 16/*exMonth*/
oChart:UnitWidth := 28
oChart:AllowInsideZoom := .T.
oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
oInsideZoomFormat:OwnerLabel := "<b><%mmmm%></b> (weeks) "
oInsideZoomFormat:InsideLabel := "<font ;6>W: <b><%ww%></b>"
oInsideZoomFormat:InsideUnit := 256/*exWeek*/
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZoom := oInsideZooms:Add("01/01/2007")
oInsideZoom:AllowCustomFormat := .T.
oInsideZoomFormat1 := oInsideZoom:CustomFormat()
oInsideZoomFormat1:OwnerLabel := "<b><%mmmm%></b> (weeks) "
oInsideZoomFormat1:InsideLabel := "<font ;6>W: <b><%ww%></b>"
oInsideZoomFormat1:InsideUnit := 256/*exWeek*/
oInsideZoomFormat1:SetProperty("BackColorChart",AutomationTranslateColor( GraMakeRGBColor ( { 187,231,240 } ) , .F. ))
oInsideZoom1 := oInsideZooms:Add("03/01/2007")
oInsideZoom1:AllowCustomFormat := .T.
oInsideZoom1:Width := 356
oInsideZoomFormat2 := oInsideZoom1:CustomFormat()
oInsideZoomFormat2:OwnerLabel := "<b><%mmmm%></b> (days) "
oInsideZoomFormat2:InsideLabel := "<font ;5><%d%></font>"
oInsideZoomFormat2:InsideUnit := 4096/*exDay*/
oInsideZoomFormat2:SetProperty("BackColorChart",AutomationTranslateColor( GraMakeRGBColor ( { 145,200,240 } ) , .F. ))
oItems := oG2antt:Items()
h := oItems:AddItem("Task 1 ")
oItems:AddBar(h,"Task","01/12/2007","03/09/2007")
h := oItems:AddItem("Task 2")
oItems:AddBar(h,"Task","01/25/2007","03/12/2007")
h := oItems:AddItem("Task 3")
oItems:AddBar(h,"Task","02/01/2007","02/08/2007","B1")
oItems:AddBar(h,"Task","02/08/2007","02/15/2007","B2")
oItems:AddBar(h,"Task","02/15/2007","02/22/2007","B3")
oItems:AddBar(h,"Task","02/22/2007","02/28/2007","B4")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
879
|
How can I define a bar that shows two colors, one up and one down, without using skin or EBN files

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBar,oBar1
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oG2antt:Chart():FirstVisibleDate := "01/01/2001"
oBar := oG2antt:Chart():Bars():Add("A")
oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oBar:Shape := 2/*exShapeSolidUp*/
oBar:Pattern := 1/*exPatternSolid*/
oBar1 := oG2antt:Chart():Bars():Add("B")
oBar1:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 128,0,0 } ) , .F. ))
oBar1:Shape := 4/*exShapeSolidDown*/
oBar1:Pattern := 1/*exPatternSolid*/
oG2antt:Chart():Bars():Add("A%B"):Shortcut := "AB"
oItems := oG2antt:Items()
h := oItems:AddItem("Task 1")
oItems:AddBar(h,"AB","01/02/2001","01/06/2001","K1")
oItems:SetProperty("ItemBar",h,"K1",12/*exBarPercent*/,1)
oItems:SetProperty("ItemBar",h,"K1",16/*exBarCanResizePercent*/,.F.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
878
|
Does your control support RightToLeft property for RTL languages or right to left
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:ScrollBars := 15/*exDisableBoth*/
oG2antt:LinesAtRoot := -1/*exLinesAtRoot*/
oColumn := oG2antt:Columns():Add("P1")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("ExpandItem",h,.T.)
oG2antt:RightToLeft := .T.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
877
|
Is there any way to display the vertical scroll bar on the left side, as I want to align my data to the right
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:ScrollBars := 15/*exDisableBoth*/
oColumns := oG2antt:Columns()
oColumns:Add("C1")
oColumns:Add("C2")
oColumns:Add("C3")
oColumns:Add("C4")
oColumns:Add("C5")
oColumns:Add("C6")
oColumns:Add("C7")
oColumns:Add("C8")
oG2antt:RightToLeft := .T.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
876
|
Can I display the cell's check box after the text
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumn := oG2antt:Columns():Add("Column")
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:SetProperty("Def",34/*exCellDrawPartsOrder*/,"caption,check")
oItems := oG2antt:Items()
oItems:SetProperty("CellHasCheckBox",oItems:AddItem("Caption 1"),0,.T.)
oItems:SetProperty("CellHasCheckBox",oItems:AddItem("Caption 2"),0,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
875
|
Can I change the order of the parts in the cell, as checkbox after the text, and so on
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oG2antt:Columns():Add("Column"):SetProperty("Def",34/*exCellDrawPartsOrder*/,"caption,check,icon,icons,picture")
oItems := oG2antt:Items()
h := oItems:AddItem("Text")
oItems:SetProperty("CellImage",h,0,1)
oItems:SetProperty("CellHasCheckBox",h,0,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
874
|
Can I have an image displayed after the text. Can I get that effect without using HTML content
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oG2antt:Columns():Add("Column"):SetProperty("Def",34/*exCellDrawPartsOrder*/,"caption,icon,check,icons,picture")
oItems := oG2antt:Items()
h := oItems:AddItem("Text")
oItems:SetProperty("CellImage",h,0,1)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
873
|
My problem is that I want to mark the cells from every second item in the gant with a other backgroundcolor

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:FirstVisibleDate := "01/17/2008"
oChart:LevelCount := 2
oChart:UnitScale := 16777216/*exSecond*/
oChart:Level(1):FormatLabel := "(0:=sec(dvalue)) mod 2 ? 0=: : '<bgcolor=00FF00>' + 0=:"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
872
|
Is there any option to print the columns section on each page

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oPrint
LOCAL oItems
LOCAL h1,h2
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Col 1")
oG2antt:Columns():Add("Col 2")
oG2antt:MarkSearchColumn := .F.
oG2antt:Chart():FirstVisibleDate := "01/01/2001"
oG2antt:Chart():LevelCount := 2
oItems := oG2antt:Items()
h1 := oItems:AddItem("Col 1")
oItems:SetProperty("CellValue",h1,1,"Col 2")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","K1")
h2 := oItems:AddItem("Col 1")
oItems:SetProperty("CellValue",h2,1,"Col 2")
oItems:AddBar(h2,"Task","02/05/2001","02/07/2001","K2")
oItems:AddLink("L1",h1,"K1",h2,"K2")
oItems:SetProperty("Link","L1",6/*exLinkStartPos*/,0)
oG2antt:EndUpdate()
oPrint := CreateObject("Exontrol.Print")
oPrint:Options := "ColumnsOnEveryPage=-2"
oPrint:PrintExt := oG2antt
oPrint:Preview()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
871
|
How can I add a different non-working area for different items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Non-Work")
oChart := oG2antt:Chart()
oChart:FirstWeekDay := 1/*exMonday*/
oChart:FirstVisibleDate := "01/24/2008"
oChart:SetProperty("PaneWidth",.F.,52)
oChart:LevelCount := 2
oItems := oG2antt:Items()
h := oItems:AddItem("January")
oItems:SetProperty("ItemNonworkingUnits",h,.F.,"month(value) = 1")
h := oItems:AddItem("February, Saturday, Sunday")
oItems:SetProperty("ItemNonworkingUnits",h,.F.,"month(value) = 2 or (weekday(value) = 0 or weekday(value) = 6)")
h := oItems:AddItem("Sunday")
oItems:SetProperty("ItemNonworkingUnits",h,.F.,"weekday(value) = 0")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
870
|
How can I define different non-working units for different items

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBar
LOCAL oChart
LOCAL oInsideZoomFormat
LOCAL oItems
LOCAL h,h1
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Tasks")
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,78)
oChart:AllowCreateBar := 1/*exCreateBarAuto*/
oChart:FirstVisibleDate := "06/20/2005"
oChart:DrawLevelSeparator := 0/*exLevelNoLine*/
oChart:LevelCount := 3
oChart:Level(1):DrawGridLines := .F.
oChart:AllowInsideZoom := .T.
oChart:DrawDateTicker := .T.
oChart:DateTickerLabel := "<%mmm%> <%d%><br><b><%hh%>:<%nn%></b>"
oChart:SetProperty("MarkSelectDateColor",0x7ffff8ee)
oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
oInsideZoomFormat:OwnerLabel := "<%mmm%> <%d%>"
oInsideZoomFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 238,248,255 } ) , .F. ))
oInsideZoomFormat:SetProperty("BackColorChart",oInsideZoomFormat:BackColor())
oInsideZoomFormat:InsideCount := 4
oInsideZoomFormat:InsideLabel := "<b><%hh%></b>"
oChart:InsideZooms():Add("06/22/2005")
oChart:DrawGridLines := 2/*exVLines*/
oChart:Bars:Item("Split"):SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oBar := oChart:Bars():Add("Task:Split")
oBar:SetProperty("Color",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oBar:Pattern := 6/*exPatternBDiagonal*/
oBar:Shortcut := "TaskS"
oItems := oG2antt:Items()
h := oItems:AddItem("Project 1")
oItems:AddBar(h,"Summary","06/21/2005","07/01/2005")
h1 := oItems:InsertItem(h,,"Task 1")
oItems:AddBar(h1,"TaskS","06/21/2005","06/28/2005")
oItems:SetProperty("ItemNonworkingUnits",h1,.F.,"weekday(value)=1 or weekday(value)=2")
oItems:SetProperty("ItemNonworkingUnits",h1,.T.,"weekday(value)=1 or weekday(value)=2 or (hour(value)<8 or hour(value)>=16 )")
oItems:DefineSummaryBars(h,"",h1,"")
h1 := oItems:InsertItem(h,,"Task 2")
oItems:AddBar(h1,"TaskS","06/22/2005 04:00:00","07/01/2005","E")
oItems:SetProperty("ItemNonworkingUnits",h1,.F.,"weekday(value)=0")
oItems:SetProperty("ItemNonworkingUnits",h1,.T.,"weekday(value)=0 or hour(value)<4 or hour(value)>19")
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ItemBar",h1,"E",21/*exBarEffort*/,5)
h1 := oItems:InsertItem(h,,"Task 3")
oItems:AddBar(h1,"TaskS","06/22/2005 12:00:00","06/27/2005","E")
oItems:SetProperty("ItemNonworkingUnits",h1,.F.,"weekday(value)=1 or weekday(value)=2")
oItems:SetProperty("ItemNonworkingUnits",h1,.T.,"weekday(value)=1 or weekday(value)=2 or (hour(value)<8 or hour(value)>=16 )")
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ExpandItem",h,.T.)
h := oItems:AddItem("Project 2")
oItems:AddBar(h,"Summary","06/26/2005","07/06/2005")
h1 := oItems:InsertItem(h,,"TaskS 1")
oItems:AddBar(h1,"TaskS","06/26/2005","07/02/2005")
oItems:DefineSummaryBars(h,"",h1,"")
h1 := oItems:InsertItem(h,,"TaskS 2")
oItems:AddBar(h1,"TaskS","06/28/2005","07/06/2005","E")
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ItemBar",h1,"E",21/*exBarEffort*/,5)
h1 := oItems:InsertItem(h,,"TaskS 3")
oItems:AddBar(h1,"TaskS","06/30/2005","07/02/2005","E")
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ExpandItem",h,.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
869
|
I want to define/highlight for specified dates as being non-working. Is this possible

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oBar
LOCAL oChart
LOCAL oItems
LOCAL c,h,p
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Items")
oChart := oG2antt:Chart()
oChart:SetProperty("NonworkingDaysColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oChart:SetProperty("PaneWidth",.F.,48)
c := oChart:NonworkingDaysColor()
p := oChart:NonworkingDaysPattern()
oChart:FirstVisibleDate := "01/01/2001"
oBar := oChart:Bars():Add("NW")
oBar:SetProperty("Color",c)
oBar:Pattern := p
oBar:Height := -1
oBar:Shape := 17/*exShapeSolidFrameless*/
oItems := oG2antt:Items()
h := oItems:AddItem("Item 1")
oItems:AddBar(h,"NW","01/02/2001","01/03/2001","0")
oItems:SetProperty("ItemBar",h,"0",29/*exBarSelectable*/,.F.)
oItems:AddBar(h,"Task","01/02/2001","01/04/2001","K2")
h := oItems:AddItem("Item 2")
oItems:AddBar(h,"NW","01/02/2001","01/04/2001","0")
oItems:SetProperty("ItemBar",h,"0",29/*exBarSelectable*/,.F.)
oItems:AddBar(h,"Task","01/02/2001","01/05/2001","K2")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
868
|
Do you have any sample how can I programmatically magnify a single date, so can show the hours, while the rest of the chart displays days

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oColumn
LOCAL oInsideZoomFormat
LOCAL oItems
LOCAL h,h1
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:MarkSearchColumn := .F.
oG2antt:ShowFocusRect := .F.
oG2antt:Columns():Add("Tasks")
oColumn := oG2antt:Columns():Add("C")
oColumn:HeaderAlignment := 1/*CenterAlignment*/
oColumn:SetProperty("Def",0/*exCellHasCheckBox*/,.T.)
oColumn:PartialCheck := .T.
oColumn:AllowSizing := .F.
oColumn:Width := 18
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,96)
oChart:AllowCreateBar := 1/*exCreateBarAuto*/
oChart:FirstVisibleDate := "06/20/2005"
oChart:DrawLevelSeparator := 0/*exLevelNoLine*/
oChart:LevelCount := 3
oChart:Level(1):DrawGridLines := .F.
oChart:AllowInsideZoom := .T.
oChart:DrawDateTicker := .T.
oChart:DateTickerLabel := "<%mmm%> <%d%><br><b><%hh%>:<%nn%></b>"
oChart:SetProperty("MarkSelectDateColor",0x7ffff8ee)
oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
oInsideZoomFormat:OwnerLabel := "<%mmm%> <%d%>"
oInsideZoomFormat:SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 238,248,255 } ) , .F. ))
oInsideZoomFormat:SetProperty("BackColorChart",oInsideZoomFormat:BackColor())
oInsideZoomFormat:InsideCount := 4
oInsideZoomFormat:InsideLabel := "<b><%hh%></b>"
oChart:InsideZooms():Add("06/22/2005")
oChart:DrawGridLines := 2/*exVLines*/
oItems := oG2antt:Items()
h := oItems:AddItem("Project 1")
oItems:AddBar(h,"Summary","06/21/2005","07/01/2005")
h1 := oItems:InsertItem(h,,"Task 1")
oItems:AddBar(h1,"Task","06/21/2005","06/28/2005")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
h1 := oItems:InsertItem(h,,"Task 2")
oItems:AddBar(h1,"Task","06/23/2005","07/01/2005","E")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ItemBar",h1,"E",21/*exBarEffort*/,5)
h1 := oItems:InsertItem(h,,"Task 3")
oItems:AddBar(h1,"Task","06/25/2005","06/27/2005","E")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("CellState",h,1,1)
h := oItems:AddItem("Project 2")
oItems:AddBar(h,"Summary","06/26/2005","07/06/2005")
h1 := oItems:InsertItem(h,,"Task 1")
oItems:AddBar(h1,"Task","06/26/2005","07/02/2005")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"")
h1 := oItems:InsertItem(h,,"Task 2")
oItems:AddBar(h1,"Task","06/28/2005","07/06/2005","E")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ItemBar",h1,"E",21/*exBarEffort*/,5)
h1 := oItems:InsertItem(h,,"Task 3")
oItems:AddBar(h1,"Task","06/30/2005","07/02/2005","E")
oItems:SetProperty("CellMerge",h1,0,1)
oItems:DefineSummaryBars(h,"",h1,"E")
oItems:SetProperty("ExpandItem",h,.T.)
oItems:SetProperty("CellState",h,1,1)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
867
|
How can I define my own/custom labels and subdivisions

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oLevel,oLevel1,oLevel2
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:ToolTip := ""
oChart:SetProperty("PaneWidth",.F.,0)
oChart:SetProperty("ScrollRange",0/*exStartDate*/,0)
oChart:SetProperty("ScrollRange",1/*exEndDate*/,110)
oChart:FirstVisibleDate := 0
oChart:ShowNonworkingDates := .F.
oChart:SetProperty("MarkTodayColor",oChart:BackColor())
oChart:LevelCount := 3
oLevel := oChart:Level(0)
oLevel:ToolTip := ""
oLevel:Alignment := 1/*CenterAlignment*/
oLevel:Unit := 4096/*exDay*/
oLevel:Count := 16
oLevel:FormatLabel := "'Group <b>'+int(1 +dvalue/16)"
oLevel1 := oChart:Level(1)
oLevel1:ToolTip := ""
oLevel1:Alignment := 1/*CenterAlignment*/
oLevel1:Unit := 4096/*exDay*/
oLevel1:Count := 4
oLevel1:FormatLabel := " (abs(dvalue)/4) mod 4"
oLevel1:SetProperty("ReplaceLabel","0","Sub-Group <b>1</b>")
oLevel1:SetProperty("ReplaceLabel","1","Sub-Group <b>2</b>")
oLevel1:SetProperty("ReplaceLabel","2","Sub-Group <b>3</b>")
oLevel1:SetProperty("ReplaceLabel","3","Sub-Group <b>4</b>")
oLevel2 := oChart:Level(2)
oLevel2:ToolTip := ""
oLevel2:Unit := 4096/*exDay*/
oLevel2:Count := 1
oLevel2:FormatLabel := "(abs(dvalue) mod 4)"
oLevel2:SetProperty("ReplaceLabel","0","A")
oLevel2:SetProperty("ReplaceLabel","1","B")
oLevel2:SetProperty("ReplaceLabel","2","C")
oLevel2:SetProperty("ReplaceLabel","3","D")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
866
|
I want to mark or highlight the last Friday of the month. Is there any option to do that

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:FirstVisibleDate := "01/17/2008"
oChart:LevelCount := 2
oChart:Level(1):FormatLabel := "(weekday(dvalue)=5 ? month(dvalue+7)!=month(dvalue) ? '<b><bgcolor=000000><fgcolor=FFFFFF>' ) + value"
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
865
|
I use the SelectDate method but the dates are not being highligted. What can I do
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2008"
oChart:SetProperty("MarkTodayColor",oChart:BackColor())
oChart:LevelCount := 2
oChart:SelectLevel := 1
oChart:SetProperty("SelectDate","01/02/2008",.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
864
|
Can I use ebn files to display the selected dates

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oAppearance
LOCAL oChart
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oAppearance := oG2antt:VisualAppearance()
oAppearance:Add(2,"c:\exontrol\images\normal.ebn")
oAppearance:Add(1,"CP:2 0 -4 0 4")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2008"
oChart:SetProperty("MarkTodayColor",oChart:BackColor())
oChart:LevelCount := 2
oChart:SetProperty("MarkSelectDateColor",0x1000000)
oChart:SelectLevel := 1
oChart:SetProperty("SelectDate","01/03/2008",.T.)
oChart:SetProperty("SelectDate","01/04/2008",.T.)
oG2antt:Columns():Add("Default")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2008","01/06/2008")
oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2008","01/07/2008")
oItems:AddBar(oItems:AddItem("Item 3"),"Task","01/04/2008","01/08/2008")
oItems:AddBar(oItems:AddItem("Item 4"),"Task","01/05/2008","01/09/2008")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
863
|
Can I use ebn files to display the selected dates

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
oChart := oG2antt:Chart()
oChart:FirstVisibleDate := "01/01/2008"
oChart:SetProperty("MarkTodayColor",oChart:BackColor())
oChart:LevelCount := 2
oChart:SetProperty("MarkSelectDateColor",0x1000000)
oChart:SelectLevel := 1
oChart:SetProperty("SelectDate","01/03/2008",.T.)
oG2antt:Columns():Add("Default")
oItems := oG2antt:Items()
oItems:AddBar(oItems:AddItem("Item 1"),"Task","01/02/2008","01/06/2008")
oItems:AddBar(oItems:AddItem("Item 2"),"Task","01/03/2008","01/07/2008")
oItems:AddBar(oItems:AddItem("Item 3"),"Task","01/04/2008","01/08/2008")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
862
|
How can I change the color for selected dates to be solid

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:FirstVisibleDate := "01/01/2008"
oChart:SetProperty("MarkTodayColor",oChart:BackColor())
oChart:LevelCount := 2
oChart:SetProperty("MarkSelectDateColor",0x7fff0000)
oChart:SelectLevel := 1
oChart:SetProperty("SelectDate","01/15/2008",.T.)
oChart:SetProperty("SelectDate","01/16/2008",.T.)
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
861
|
How can I disable selecting dates when I click the chart's header
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Chart():AllowSelectDate := 0/*exNoSelectDate*/
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
860
|
Is there any option to specify which dates can be magnified or resized
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:ShowNonworkingDates := .T.
oChart:CondInsideZoom := "not(weekday(value) = 0 or weekday(value) = 6)"
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
859
|
How can I change the width for a specified date time unit

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZoom
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oInsideZooms := oChart:InsideZooms()
oInsideZoom := oInsideZooms:Add("01/04/2008")
oInsideZoom:Width := 32
oInsideZoom:AllowInsideFormat := .F.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
858
|
How can I disable the control's splitter so the user can't resize the list area
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:OnResizeControl := 129/*exDisableSplitter+exResizeChart*/
oG2antt:Chart():SetProperty("PaneWidth",.F.,60)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
857
|
How can I disable the control's splitter so the user can't resize the chart area
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:OnResizeControl := 128/*exDisableSplitter*/
oG2antt:Chart():SetProperty("PaneWidth",.T.,60)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
856
|
How can I change the label for a specified unit

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oChart:DefaultInsideZoomFormat():OwnerLabel := "<b><%d%></b> <%d2%>"
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZooms:DefaultWidth := 32
oInsideZooms:Add("01/04/2008"):AllowInsideFormat := .F.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
855
|
How can I bold the inside units

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oChart:DefaultInsideZoomFormat():InsideLabel := "<b><%hh%></b>"
oChart:InsideZooms():Add("01/04/2008")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
854
|
How can I change the scale unit when doing inside zoom ( the chart displays weeks, and we want week days )

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZoomFormat
LOCAL oInsideZooms
LOCAL oLevel,oLevel1
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:ShowNonworkingDates := .F.
oChart:SetProperty("PaneWidth",.F.,0)
oChart:LevelCount := 2
oLevel := oChart:Level(0)
oLevel:Label := "<%mmmm%>"
oLevel:Unit := 16/*exMonth*/
oLevel1 := oChart:Level(1)
oLevel1:Label := "<%ww%>"
oLevel1:Unit := 256/*exWeek*/
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
oInsideZoomFormat:OwnerLabel := "<font ;7><%mmm%> Week: <%ww%>"
oInsideZoomFormat:InsideLabel := "<font ;7><b><%d1%></b>"
oInsideZoomFormat:InsideUnit := 4096/*exDay*/
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZooms:Add("02/03/2008")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
853
|
How can I zoom or magnify the selected date to display the hours, from 8 to 8

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZoomFormat
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oInsideZoomFormat := oChart:DefaultInsideZoomFormat()
oInsideZoomFormat:InsideLabel := "H: <b><%hh%></b>"
oInsideZoomFormat:InsideUnit := 65536/*exHour*/
oInsideZoomFormat:InsideCount := 8
oInsideZooms := oChart:InsideZooms()
oInsideZooms:Add("01/04/2008")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
852
|
How can I zoom or magnify the selected date to display the hours

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:SetProperty("PaneWidth",.F.,0)
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oInsideZooms := oChart:InsideZooms()
oInsideZooms:Add("01/04/2008")
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
851
|
How can I change the foreground color for a time unit

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oChart:DefaultInsideZoomFormat():SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZooms:DefaultWidth := 18
oInsideZooms:Add("01/04/2008"):AllowInsideFormat := .F.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
850
|
How can I change the background color for a time unit, in the chart area

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oChart:DefaultInsideZoomFormat():SetProperty("BackColorChart",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZooms:DefaultWidth := 18
oInsideZooms:Add("01/04/2008"):AllowInsideFormat := .F.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
849
|
How can I change the background color for a time unit, using EBN files

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oChart:DefaultInsideZoomFormat():SetProperty("BackColor",0x1000000)
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZooms:DefaultWidth := 18
oInsideZooms:Add("01/04/2008"):AllowInsideFormat := .F.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
848
|
How can I change the background color for a time unit

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oChart
LOCAL oInsideZooms
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oChart := oG2antt:Chart()
oChart:LevelCount := 2
oChart:FirstVisibleDate := "01/01/2008"
oChart:AllowInsideZoom := .T.
oChart:AllowResizeInsideZoom := .F.
oChart:InsideZoomOnDblClick := .F.
oChart:DefaultInsideZoomFormat():SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oInsideZooms := oChart:InsideZooms()
oInsideZooms:SplitBaseLevel := .F.
oInsideZooms:DefaultWidth := 18
oInsideZooms:Add("01/04/2008"):AllowInsideFormat := .F.
oG2antt:EndUpdate()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
847
|
How can I display the column using currency format and enlarge the font for certain values
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumn := oG2antt:Columns():Add("Currency")
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn:FormatColumn := "len(value) ? ((0:=dbl(value)) < 10 ? '<fgcolor=808080><font ;7>' : '<b>') + currency(=:0)"
oItems := oG2antt:Items()
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oItems:AddItem("9.94")
oItems:AddItem("11.94")
oItems:AddItem("1000")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
846
|
How can I highlight only parts of the cells
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumn := oG2antt:Columns():Add("")
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn:FormatColumn := "value replace 'hil' with '<fgcolor=FF0000><b>hil</b></fgcolor>'"
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Child 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
845
|
How can I get the number of occurrences of a specified string in the cell
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("")
oColumn := oG2antt:Columns():Add("occurrences")
oColumn:ComputedField := "lower(%0) count 'o'"
oColumn:FormatColumn := "'contains ' + value + ' of \'o\' chars'"
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1 oooof the root")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Child 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
844
|
How can I display dates in my format
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumn := oG2antt:Columns():Add("Date")
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn:FormatColumn := "'<b>' + year(0:=date(value)) + '</b><fgcolor=808080><font ;6> (' + month(=:0) + ' - ' + day(=:0) +')'"
oItems := oG2antt:Items()
oItems:AddItem("01/21/2001")
oItems:AddItem("02/22/2002")
oItems:AddItem("03/13/2003")
oItems:AddItem("04/24/2004")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
843
|
How can I display dates in short format
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date"):FormatColumn := "shortdate(value)"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001")
oItems:AddItem("02/02/2002")
oItems:AddItem("03/03/2003")
oItems:AddItem("04/04/2004")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
842
|
How can I display dates in long format
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date"):FormatColumn := "longdate(value)"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001")
oItems:AddItem("02/02/2002")
oItems:AddItem("03/03/2003")
oItems:AddItem("04/04/2004")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
841
|
How can I display only the right part of the cell
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("")
oColumn := oG2antt:Columns():Add("Right")
oColumn:ComputedField := "%0 right 2"
oColumn:FormatColumn := "'" + CHR(34) + "' + value + '" + CHR(34) + "'"
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"SChild 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
840
|
How can I display only the left part of the cell
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("")
oG2antt:Columns():Add("Left"):ComputedField := "%0 left 2"
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"SChild 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
839
|
How can I display true or false instead 0 and -1
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Boolean"):FormatColumn := "value != 0 ? 'true' : 'false'"
oItems := oG2antt:Items()
oItems:AddItem(.T.)
oItems:AddItem(.F.)
oItems:AddItem(.T.)
oItems:AddItem(0)
oItems:AddItem(1)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
838
|
Is there any option to print the columns section on each page

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oPrint
LOCAL oItems
LOCAL h1,h2
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oG2antt:Chart():FirstVisibleDate := "01/01/2001"
oG2antt:Chart():LevelCount := 2
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","K1")
h2 := oItems:AddItem("Task 2")
oItems:AddBar(h2,"Task","02/05/2001","02/07/2001","K2")
oItems:AddLink("L1",h1,"K1",h2,"K2")
oItems:SetProperty("Link","L1",6/*exLinkStartPos*/,0)
oG2antt:EndUpdate()
oPrint := CreateObject("Exontrol.Print")
oPrint:Options := "ColumnsOnEveryPage=1"
oPrint:PrintExt := oG2antt
oPrint:Preview()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
837
|
How do I print the control's content

#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oPrint
LOCAL oItems
LOCAL h1,h2
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:BeginUpdate()
oG2antt:Columns():Add("Task")
oG2antt:Chart():FirstVisibleDate := "01/01/2001"
oItems := oG2antt:Items()
h1 := oItems:AddItem("Task 1")
oItems:AddBar(h1,"Task","01/02/2001","01/04/2001","K1")
h2 := oItems:AddItem("Task 2")
oItems:AddBar(h2,"Task","01/05/2001","01/07/2001","K2")
oItems:AddLink("L1",h1,"K1",h2,"K2")
oItems:SetProperty("Link","L1",6/*exLinkStartPos*/,0)
oG2antt:EndUpdate()
oPrint := CreateObject("Exontrol.Print")
oPrint:PrintExt := oG2antt
oPrint:Preview()
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
836
|
How can I display icons or images instead numbers
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumn
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Images("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTqlVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/yNAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA=")
oColumn := oG2antt:Columns():Add("Icons")
oColumn:SetProperty("Def",17/*exCellValueFormat*/,1)
oColumn:FormatColumn := "'The cell displays the icon <img>'+value+'</img> instead ' + value"
oItems := oG2antt:Items()
oItems:AddItem(1)
oItems:AddItem(2)
oItems:AddItem(3)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
835
|
How can I display the column using currency
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Currency"):FormatColumn := "currency(dbl(value))"
oItems := oG2antt:Items()
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oItems:AddItem("0")
oItems:AddItem(5)
oItems:AddItem("10000.99")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
834
|
How can I display the currency only for not empty cells
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Currency"):ComputedField := "len(%0) ? currency(dbl(%0)) : ''"
oItems := oG2antt:Items()
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oItems:AddItem("0")
oItems:SetProperty("ItemBackColor",oItems:AddItem(),AutomationTranslateColor( GraMakeRGBColor ( { 255,128,128 } ) , .F. ))
oItems:AddItem("10000.99")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
833
|
Is there a function to display the number of days between two date including the number of hours
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Start"):Width := 32
oG2antt:Columns():Add("End")
oG2antt:Columns():Add("Duration"):ComputedField := "((1:=int(0:= (date(%1)-date(%0)))) != 0 ? (=:1 + ' day(s)') : '') + (=:1 ? ' ' : '' ) + ((1:=int(0:=((=:0 - =:1 + 1/24/60/60/2)*24))) != 0 ? =:1 + ' hour(s) ' : '' ) + ((1:=round((=:0 - =:1)*60)) != 0 ? =:1 + ' min(s)' : '')"
oItems := oG2antt:Items()
h := oItems:AddItem("01/11/2001")
oItems:SetProperty("CellValue",h,1,"01/14/2001")
h := oItems:AddItem("02/22/2002 12:00:00")
oItems:SetProperty("CellValue",h,1,"03/14/2002 13:00:00")
h := oItems:AddItem("03/13/2003")
oItems:SetProperty("CellValue",h,1,"04/11/2003 11:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
832
|
Is there a function to display the number of days between two date including the number of hours
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Start")
oG2antt:Columns():Add("End")
oG2antt:Columns():Add("Duration"):ComputedField := "" + CHR(34) + "D " + CHR(34) + " + int(date(%1)-date(%0)) + " + CHR(34) + " H " + CHR(34) + " + round(24*(date(%1)-date(%0) - floor(date(%1)-date(%0))))"
oItems := oG2antt:Items()
h := oItems:AddItem("01/11/2001")
oItems:SetProperty("CellValue",h,1,"01/14/2001 23:00:00")
h := oItems:AddItem("02/22/2002 12:00:00")
oItems:SetProperty("CellValue",h,1,"03/14/2002 13:00:00")
h := oItems:AddItem("03/13/2003")
oItems:SetProperty("CellValue",h,1,"04/11/2003 11:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
831
|
How can I display the number of days between two dates
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Start")
oG2antt:Columns():Add("End")
oG2antt:Columns():Add("Duration"):ComputedField := "(date(%1)-date(%0)) + ' days'"
oItems := oG2antt:Items()
h := oItems:AddItem("01/11/2001")
oItems:SetProperty("CellValue",h,1,"01/14/2001")
h := oItems:AddItem("02/22/2002")
oItems:SetProperty("CellValue",h,1,"03/14/2002")
h := oItems:AddItem("03/13/2003")
oItems:SetProperty("CellValue",h,1,"04/11/2003")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
830
|
How can I get second part of the date
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Second"):ComputedField := "sec(date(%0))"
oItems := oG2antt:Items()
oItems:AddItem("01/11/2001 10:10:00")
oItems:AddItem("02/22/2002 11:01:22")
oItems:AddItem("03/13/2003 12:23:01")
oItems:AddItem("04/14/2004 13:11:59")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
829
|
How can I get minute part of the date
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Minute"):ComputedField := "min(date(%0))"
oItems := oG2antt:Items()
oItems:AddItem("01/11/2001 10:10:00")
oItems:AddItem("02/22/2002 11:01:00")
oItems:AddItem("03/13/2003 12:23:00")
oItems:AddItem("04/14/2004 13:11:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
828
|
How can I check the hour part only so I know it was afternoon
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ConditionalFormats():Add("hour(%0)>=12"):Bold := .T.
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Hour"):ComputedField := "hour(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/11/2001 10:00:00")
oItems:AddItem("02/22/2002 11:00:00")
oItems:AddItem("03/13/2003 12:00:00")
oItems:AddItem("04/14/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
827
|
What about a function to get the day in the week, or days since Sunday
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("WeekDay"):ComputedField := "weekday(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/11/2001 10:00:00")
oItems:AddItem("02/22/2002 11:00:00")
oItems:AddItem("03/13/2003 12:00:00")
oItems:AddItem("04/14/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
826
|
Is there any function to get the day of the year or number of days since January 1st
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Day since January 1st"):ComputedField := "yearday(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/11/2001 10:00:00")
oItems:AddItem("02/22/2002 11:00:00")
oItems:AddItem("03/13/2003 12:00:00")
oItems:AddItem("04/14/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
825
|
How can I display only the day of the date
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Day"):ComputedField := "day(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/11/2001 10:00:00")
oItems:AddItem("02/22/2002 11:00:00")
oItems:AddItem("03/13/2003 12:00:00")
oItems:AddItem("04/14/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
824
|
How can I display only the month of the date
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Month"):ComputedField := "month(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001 10:00:00")
oItems:AddItem("02/02/2002 11:00:00")
oItems:AddItem("03/03/2003 12:00:00")
oItems:AddItem("04/04/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
823
|
How can I get only the year part from a date expression
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Year"):ComputedField := "year(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001 10:00:00")
oItems:AddItem("02/02/2002 11:00:00")
oItems:AddItem("03/03/2003 12:00:00")
oItems:AddItem("04/04/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
822
|
Can I convert the expression to date
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Date"):ComputedField := "date(dbl(%0))"
oItems := oG2antt:Items()
oItems:AddItem("-1.98")
oItems:AddItem("30000.99")
oItems:AddItem("3561.23")
oItems:AddItem("1232.34")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
821
|
Can I convert the expression to a number, double or float
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Number + 2"):ComputedField := "dbl(%0)+2"
oItems := oG2antt:Items()
oItems:AddItem("-1.98")
oItems:AddItem("0.99")
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
820
|
How can I display dates in long format
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("LongFormat"):ComputedField := "longdate(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001 10:00:00")
oItems:AddItem("02/02/2002 11:00:00")
oItems:AddItem("03/03/2003 12:00:00")
oItems:AddItem("04/04/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
819
|
How can I display dates in short format
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("ShortFormat"):ComputedField := "shortdate(%0)"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001 10:00:00")
oItems:AddItem("02/02/2002 11:00:00")
oItems:AddItem("03/03/2003 12:00:00")
oItems:AddItem("04/04/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
818
|
How can I display the time only of a date expression
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Date")
oG2antt:Columns():Add("Time"):ComputedField := "'time is:' + time(date(%0))"
oItems := oG2antt:Items()
oItems:AddItem("01/01/2001 10:00:00")
oItems:AddItem("02/02/2002 11:00:00")
oItems:AddItem("03/03/2003 12:00:00")
oItems:AddItem("04/04/2004 13:00:00")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
817
|
Is there any function to display currencies, or money formatted as in the control panel
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Currency"):ComputedField := "currency(dbl(%0))"
oItems := oG2antt:Items()
oItems:AddItem(1.23)
oItems:AddItem(2.34)
oItems:AddItem(10000.99)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
816
|
How can I convert the expression to a string so I can look into the date string expression for month's name
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Str"):ComputedField := "str(%0) + ' AA'"
oItems := oG2antt:Items()
oItems:AddItem("-1.98")
oItems:AddItem("0.99")
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
815
|
Can I display the absolute value or positive part of the number
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Abs"):ComputedField := "abs(%0)"
oItems := oG2antt:Items()
oItems:AddItem("-1.98")
oItems:AddItem("0.99")
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
814
|
Is there any function to get largest number with no fraction part that is not greater than the value
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Floor"):ComputedField := "floor(%0)"
oItems := oG2antt:Items()
oItems:AddItem("-1.98")
oItems:AddItem("0.99")
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
813
|
Is there any function to round the values base on the .5 value
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Round"):ComputedField := "round(%0)"
oItems := oG2antt:Items()
oItems:AddItem("-1.98")
oItems:AddItem("0.99")
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
812
|
How can I get or display the integer part of the cell
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add("Number")
oG2antt:Columns():Add("Int"):ComputedField := "int(%0)"
oItems := oG2antt:Items()
oItems:AddItem("-1.98")
oItems:AddItem("0.99")
oItems:AddItem("1.23")
oItems:AddItem("2.34")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
811
|
How can I display names as proper ( first leter of the word must be in uppercase, and the rest in lowercase )
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add(""):FormatColumn := "proper(%0)"
oItems := oG2antt:Items()
h := oItems:AddItem("root")
oItems:InsertItem(h,,"child child")
oItems:InsertItem(h,,"child child")
oItems:InsertItem(h,,"child child")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
810
|
Is there any option to display cells in uppercase
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add(""):FormatColumn := "upper(%0)"
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Chld 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
809
|
Is there any option to display cells in lowercase
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:Columns():Add(""):FormatColumn := "lower(%0)"
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Chld 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
808
|
How can I mark the cells that has a specified type, ie strings only
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ConditionalFormats():Add("type(%0) = 8"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oG2antt:Columns():Add("")
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,2)
oItems:InsertItem(h,,"Chld 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
807
|
How can I bold the items that contains data or those who displays empty strings
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h,hC
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ConditionalFormats():Add("not len(%1)=0"):Bold := .T.
oG2antt:Columns():Add("C1")
oG2antt:Columns():Add("C2")
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
hC := oItems:InsertItem(h,,"Child 2")
oItems:SetProperty("CellValue",hC,1,"1")
oItems:InsertItem(h,,"Child 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
806
|
Can I change the background color for items or cells that contains a specified string
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ConditionalFormats():Add("%0 contains 'hi'"):SetProperty("BackColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oG2antt:Columns():Add("")
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"Chld 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
805
|
Is there any option to change the fore color for cells or items that ends with a specified string
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ConditionalFormats():Add("%0 endwith '22'"):SetProperty("ForeColor",AutomationTranslateColor( GraMakeRGBColor ( { 255,0,0 } ) , .F. ))
oG2antt:Columns():Add("")
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 1.22")
oItems:InsertItem(h,,"Child 2.22")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
804
|
How can I highlight the cells or items that starts with a specified string
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oItems
LOCAL h
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:ConditionalFormats():Add("%0 startwith 'C'"):Underline := .T.
oG2antt:Columns():Add("")
oItems := oG2antt:Items()
h := oItems:AddItem("Root")
oItems:InsertItem(h,,"Child 1")
oItems:InsertItem(h,,"Child 2")
oItems:InsertItem(h,,"SChild 3")
oItems:SetProperty("ExpandItem",h,.T.)
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
803
|
How can I change the background color or the visual appearance using ebn for a particular column
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oG2antt:VisualAppearance():Add(1,"c:\exontrol\images\normal.ebn")
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):SetProperty("Def",7/*exHeaderBackColor*/,16777216)
oColumns:Add("Column 3"):SetProperty("Def",7/*exHeaderBackColor*/,16777471)
oColumns:Add("Column 4")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
802
|
How can I change the foreground color for a particular column
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):SetProperty("Def",8/*exHeaderForeColor*/,8439039)
oColumns:Add("Column 3")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|
801
|
How can I change the background color for a particular column
#include "AppEvent.ch"
#include "ActiveX.ch"
PROCEDURE Main
LOCAL oForm
LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
LOCAL oG2antt
LOCAL oColumns
oForm := XbpDialog():new( AppDesktop() )
oForm:drawingArea:clipChildren := .T.
oForm:create( ,,{100,100}, {640,480},, .F. )
oForm:close := {|| PostAppEvent( xbeP_Quit )}
oG2antt := XbpActiveXControl():new( oForm:drawingArea )
oG2antt:CLSID := "Exontrol.G2antt.1" /*{CD481F4D-2D25-4759-803F-752C568F53B7}*/
oG2antt:create(,, {10,60},{610,370} )
oColumns := oG2antt:Columns()
oColumns:Add("Column 1")
oColumns:Add("Column 2"):SetProperty("Def",7/*exHeaderBackColor*/,8439039)
oColumns:Add("Column 3")
oForm:Show()
DO WHILE nEvent != xbeP_Quit
nEvent := AppEvent( @mp1, @mp2, @oXbp )
oXbp:handleEvent( nEvent, mp1, mp2 )
ENDDO
RETURN
|